home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / startrek / trek73 / src / defines.h < prev    next >
C/C++ Source or Header  |  1995-04-11  |  2KB  |  106 lines

  1. /*
  2.  * TREK73: defines.h
  3.  *
  4.  * Defines for TREK73
  5.  *
  6.  */
  7.  
  8. /* Globals externals */
  9. extern char *malloc(), *strcpy(), *gets();
  10.  
  11. #ifdef BSD
  12. extern long random();
  13. #define SRANDOM(a) (void)srandom((int)a)
  14. #define RANDOM random
  15. #else
  16. extern int rand();
  17. #define SRANDOM(a) srand((unsigned int)a)
  18. #define RANDOM rand
  19. #endif
  20.  
  21. #define randm(x) ((int)(RANDOM() % (x)) + 1)
  22. #define toradians(x) ((float)(x)*.0174533)
  23. #define todegrees(x) ((float)(x)*57.2958)
  24.  
  25.  
  26. #ifndef min    /* Somes a macro, sometimes not */
  27. #define min(x, y) ((x) < (y) ? (x) : (y))
  28. #endif
  29.  
  30. #ifndef max    /* Somes a macro, sometimes not */
  31. #define max(x, y) ((x) > (y) ? (x) : (y))
  32. #endif
  33.  
  34. #ifndef NULL
  35. #define NULL 0
  36. #endif
  37.  
  38. /*
  39.  * for the item linked list
  40.  */
  41. #define I_UNDEFINED    0
  42. #define I_SHIP        1
  43. #define I_TORPEDO    2
  44. #define I_PROBE        3
  45. #define I_ENG        4
  46.  
  47. /*
  48.  * for the ship status word
  49.  */
  50. #define S_NORMAL    000
  51. #define S_COMP        001
  52. #define S_SENSOR    002
  53. #define S_PROBE        004
  54. #define S_WARP        010
  55. #define S_ENG        020
  56. #define S_DEAD        040
  57. #define S_SURRENDER    0100
  58.  
  59. /*
  60.  * for the status message turn off array
  61.  */
  62. #define DISENGAGE    1
  63. #define SHIELDSF    2
  64. #define PHASERS        3
  65. #define TUBES        7
  66. #define SURRENDER    13
  67. #define SURRENDERP    14
  68. #define PLAYDEAD    15
  69. #define CORBOMITE    16
  70. #define BURNOUT        17
  71. #define HIGHSHUTUP    27
  72.  
  73. /*
  74.  * Defines for the play status word
  75.  */
  76. #define NORMAL        000
  77. #define F_SURRENDER    001
  78. #define E_SURRENDER    002
  79.  
  80. /*
  81.  * Phaser statuses
  82.  */
  83. #define P_NORMAL    000
  84. #define P_DAMAGED    001
  85. #define P_FIRING    002
  86.  
  87. /*
  88.  * Tube statuses
  89.  */
  90. #define T_NORMAL    000
  91. #define T_DAMAGED    001
  92. #define T_FIRING    002
  93.  
  94. /*
  95.  * Ship search routine directives
  96.  */
  97. #define ALL        0
  98. #define ENEMYONLY    1
  99.  
  100. #define MKNODE(cast, star, number) (cast star)malloc(sizeof(cast) * number)
  101.  
  102. #define MAXBADS 9
  103. #define MAXFEDS 9
  104. #define MAXENCOMM 9
  105. #define MAXFOERACES 9
  106.